﻿@model IEnumerable<LTM.School.Core.Models.Course>

@{
    ViewData["Title"] = "课程信息";
}

<h2>课程信息</h2>

<p>
    <a asp-action="Create">添加课程</a>
    <a asp-action="UpdateCourseCredits">修改所有课程学分</a>
</p>
<table class="table">
    <thead>
        <tr> <th>
                @Html.DisplayNameFor(model => model.CourseId)
            </th>
                <th>
                    @Html.DisplayNameFor(model => model.Title)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Credits)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Grade)
                </th>
            <th>
                @Html.DisplayNameFor(model => model.Department)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr><td>
    @Html.DisplayFor(modelItem => item.CourseId)
</td>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Credits)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Grade)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Department.Name)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.CourseId">编辑</a> |
                <a asp-action="Details" asp-route-id="@item.CourseId">详情</a> |
                <a asp-action="Delete" asp-route-id="@item.CourseId">删除</a>
            </td>
        </tr>
}
    </tbody>
</table>
